<?php
/* @var $this StudentController */
/* @var $model Student */
/* Yii::app()->clientScript->scriptMap=array(
'jquery.js'=>false,
'jquery.ba-bbq.js'=>false,
); */
Yii::app()->clientScript->registerScript('search', "

$('.search-form form').submit(function(){
	$('#student-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<div class="search-form" >
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'student-grid',
	'summaryText'=>'',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
		'selectionChanged'=>"function(id){
				getStudent($.fn.yiiGridView.getSelection(id));
             
		
		}",
	'columns'=>array(
			array(
					'header'=>'รหัสนักศึกษา',
					'htmlOptions'=>array('width'=>'120px'),
					'value'=>'$data->student_id',
					'filter'=>CHtml::activetextField($model,'student_id'),
			),
		array(
			'header'=>'ชื่อนักศึกษา',
			'value'=>'$data->student_name." ".$data->student_surname',	
			'filter'=>CHtml::activetextField($model,'student_name'),		
			),
	),
)); ?>
